<?php
class Personaladdress_Model_Personaladdress implements Personaladdress_Model_Mainable{
    
    private $core_controller_csrftoken;
    private $action_handler;
    
    public function main(array $variables = null) {
        if(isset($variables['get']['page'])){
            $this->action_handler = new Personaladdress_Model_Pagedecision;
            return $this->action_handler->main($variables);
        }
        else {
            $this->core_controller_csrftoken = new Core_Controller_Csrftoken;
            $this->action_handler = new Personaladdress_Data_Getaddressdata;
            
            $page['csrf_token'] = $this->core_controller_csrftoken->main($variables);
            $page['content'] = $this->action_handler->main($variables);
            $page['template'] = WEB_ROOT_FOLDER."personaladdress/views/userdata.php";
            
            return $page;
        }
    }
    
    
}
